/**
 * Copyright (c) 2018 人人开源 All rights reserved.
 * <p>
 * https://www.renren.io
 * <p>
 * 版权所有，侵权必究！
 */

package io.renren.common.config;

import cn.hutool.json.JSONUtil;
import com.alibaba.druid.support.json.JSONUtils;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.mysql.jdbc.StringUtils;
import groovy.util.logging.Slf4j;
import io.renren.common.service.BaseService;
import io.renren.common.utils.PermissionsUtils;
import io.renren.modules.security.service.ShiroService;
import io.renren.modules.sys.dto.SysMenuDTO;
import io.renren.modules.sys.service.SysMenuService;
import org.apache.ibatis.exceptions.PersistenceException;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import sun.tools.util.CommandLine;

import java.util.*;


/**
 * 生成验证码配置
 *
 * @author Mark sunlightcs@gmail.com
 */
@Component
@Slf4j
public class InitPermissionsConfig implements CommandLineRunner {

    public final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private SysMenuService sysMenuService;

    @Override
    public void run(String... args) throws Exception {
        System.out.println(">>>>>>>>>>>>>>>服务启动执行，执行加载数据等操作<<<<<<<<<<<<<");
        sysMenuService.batchMenuList();
    }
}
